﻿using System.Collections;
using System.Collections.Generic;

namespace Fast.Extensions
{
    /// <summary>
    /// 集合扩展类
    /// </summary>
    [SkipScan]
    public static class FastCollectionExtensions
    {
        /// <summary>
        /// 检查给定泛型集合对象是否为null或是否没有项。
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="source"></param>
        /// <returns></returns>
        public static bool IsNullOrEmpty<T>(this ICollection<T> source)
        {
            return source == null || source.Count <= 0;
        }
    }
}
